<extend name="Public:base" />
<block name="style">
    <style>
        .main{width:830px;}
        #div{width:100%;height:70px;}
        #img{width:240px;height:280px;}
    </style>
</block>

<block name="main">
    <div class="main">
        <div class="mainbg"></div>
        <div class="personal-settings">
            <div class="photo-tab">
                <ul class="clearfix" id="ul">

                    <li class='hover' style="margin-left:60px;">个人资料设置（ZOL个人中心）</li>

                    <li style="margin-left:60px;">修改密码（ZOL个人中心）</li>

                </ul>
            </div>

            <div id="cont">
                <!--用户个人信息-->
                <div class="add-address"  id="info" style="display:block">
                    <div style="width:400px;height:100%;float:left">
                        <form action="{:U('User/info')}" method="post">
                            <input type="hidden" name='id' value={$info.id} />
                            <div class="item item2">
                                <label class="list-title" for=""><i>*</i>用户名：</label>
                                <p>
                                    <input class="text" maxlength="30" type="text" name='username' value="{$info.username}" disabled/><b class="correct"></b><b class="error"></b></p>
                            </div>
                          
                            <div class="item item2">
                                <label class="list-title" for=""><i>*</i>真实姓名：</label>
                                <p>
                                    <input class="text" type="text" maxlength="30" name='name' value="{$info.name}"/><b class="correct"></b><b class="error"></b></p>
                            </div>
                            <div class="item item2">
                                <label class="list-title" for=""><i>*</i>性别：</label>
                                <p>
                                    <input type="radio" name='sex' value="0" {$info['sex']==0?'checked':''}/>女
                                    <input type="radio" name='sex' value="1" {$info['sex']==1?'checked':''}/>男<b class="correct"></b><b class="error"></b></p>
                            </div>
                            
                            <div class="item item2">
                                <label class="list-title" for=""><i>*</i>电话：</label>
                                <p>
                                    <input class="text" maxlength="30" type="text" name='phone' value="{$info.phone}"/><b class="correct"></b><b class="error"></b></p>
                            </div>
                            <div class="item item2">
                                <label class="list-title" for=""><i>*</i>联系地址：</label>
                                <p>
                                    <input class="text" type="text" maxlength="30" name='address' value="{$info.address}"/><b class="correct"></b><b class="error"></b></p>
                            </div>
                            <div class="item item2">
                                <label class="list-title" for=""><i>*</i>邮编：</label>
                                <p>
                                    <input class="text" type="text" maxlength="6" name='code' value="{$info.code}"/><b class="correct"></b><b class="error"></b></p>
                            </div>
                            <div class="item item2">
                                <label class="list-title" for=""><i>*</i>注册时间：</label>
                                <p>
                                    <input class="text" maxlength="30" type="text" name='addtime' value="{$info.addtime}"disabled/><b class="correct"></b><b class="error"></b></p>
                                
                                <!--<p><input type="submit" value='提交'></p>-->
                            </div>
                            <div class="item item2">
                                <p><input type="submit" value='提交' style="width:80px;height:40px;background:lightblue" /></p>
                            </div>
                        </form>
                    </div>
                    <div style="width:360px;height:100%;float:left;">
                        <form action="{:U('User/photo')}" enctype="multipart/form-data" method="post">
                            <input type="hidden" name='id' value='$info.id' />
                            <if condition="$info.photo eq NULL">
                            <div style="margin-top:150px;margin-left:100px">
                                <img src="__PUBLIC__/imgs/pic.jpg" width='200px' height='200px'/>
                            </div>
                            <else />
                            <div style="margin-top:100px;margin-left:100px">
                                <img src="__ROOT__/Uploads/Public/{$info.photo}" id='img' />
                            </div>
                            </if>
                            <div class="item item2" style="">
                                <input class="text" type="file" name='photo' />
                                <p><input type="submit" value='修改头像' style="width:80px;height:40px;background:lightblue;margin-top:10px;"/></p>
                            </div>

                        </form>
                    </div>
                </div>

                
                <!-- 个人密码修改 -->
                <div class="add-address"  id="pass" style="margin-left:200px;display:none">
                    <form action="{:U('User/pass')}" method='post'>
                        <div id="div"></div>
                        <div class="item item2">
                            <label class="list-title" for=""><i>*</i>原密码：</label>
                            <p>
                                <input class="text" type="password" maxlength="16" name="oldpass"/><b class="correct"></b><b class="error"></b></p>
                        </div>
                        <div class="item item2">
                            <label class="list-title" for=""><i>*</i>新密码：</label>
                            <p>
                                <input class="text" maxlength="16" type="password" name="pass"/><b class="correct"></b><b class="error"></b></p>
                        </div>
                        <div class="item item2">
                            <label class="list-title" for=""><i>*</i>确认密码：</label>
                            <p>
                                <input class="text" id="" maxlength="16" type="password" name="repass"/><b class="correct"></b><b class="error"></b></p>
                            
                            <p><input type="submit" value="提交" style="width:80px;height:40px;background:lightblue"/></p>
                        </div>
                    </form>
                </div>
         
            </div>   
        </div>     
        <script type="text/javascript">
        var ul = document.getElementById('ul');
        var lis = ul.getElementsByTagName('li');
        var cont = document.getElementById('cont');
        var divs = cont.getElementsByClassName('add-address');

         for(var i=0;i<lis.length;i++){
            lis[i].index = i;
            lis[i].onclick = function(){

                for(var j=0;j<lis.length;j++){
                    lis[j].className = '';
                    divs[j].style.display = 'none';
                }
                this.className = 'hover';
                divs[ this.index ].style.display = 'block';
                
            }
        }
        </script>
    </div>
</block>

